package co.fitstart.entity.principal;

import com.demo2do.core.utils.Alias;

/**
 * 二维码类型
 * @author wangliwang
 *
 */
@Alias("QrcodeType")
public enum QrcodeType {
    
    ON_LINE(1 , "线上二维码"),
    
    OFF_LINE(0 , "线下二维码"),
    
    GROUP_BLOCK(2 , "免费减脂营群二维码");
    
    private Integer alias;
    
    private String description;

    /**
     * 
     * @param alias
     * @param description
     */
    private QrcodeType(Integer alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @return
     */
    public String getName() {
        return this.name();
    }

    /**
     * 
     * @return
     */
    public Integer getAlias() {
        return alias;
    }

    /**
     * 
     * @return
     */
    public String getDescription() {
        return description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static QrcodeType aliasOf(Integer alias) {
        for(QrcodeType qrcodeType : QrcodeType.values()){
            if (qrcodeType.getAlias() == alias) {
                return qrcodeType;
            }
        }
        return null;
    }
}
